<!DOCTYPE html>
<html>
	<head>
		<style type="text/css">
		.cancel_btn
		{
		margin:10px 0px 5px 35px
		}
		.continue_btn
		{
		margin:10px 35px 5px 0px
		}
		.selection_btn
		{
		background-image: url("file:///android_res/drawable/dropdown_bg.png");
		}
		</style>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title></title>
		<link rel="stylesheet" href="../css/styles.css" />
		<!-- <link rel="stylesheet" href="https://d10ajoocuyu32n.cloudfront.net/mobile/1.3.1/jquery.mobile-1.3.1.min.css"> -->
		<link rel="stylesheet" href="../css/jquery.mobile-1.3.1.min.css">
		<link rel="stylesheet" href="file:///android_asset/css/in.css">
		<!-- Extra Codiqa features -->
		<link rel="stylesheet" href="codiqa.ext.css">
		<!-- jQuery and jQuery Mobile -->
		<script src="https://d10ajoocuyu32n.cloudfront.net/jquery-1.9.1.min.js"></script>
		<script src="https://d10ajoocuyu32n.cloudfront.net/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
		<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
		<!-- Extra Codiqa features -->
		<script src="https://d10ajoocuyu32n.cloudfront.net/codiqa.ext.js"></script>
		<script src="file:///android_asset/js/login.js"></script>
	</head>
	<body>
		<div class="ui-header ui-bar-b" align="center" data-theme="b" data-role="header" role="banner">
			<p style="padding:10px;">
			<font size="3"> Boulder Search Results </font></p>
			<img style="float:right;height:35px; margin:-37px 6px 0px 0px;width:50px;border-radius:10px;" src="../images/signout.png" onclick="signout()">
		</div>
		<div class="container">
		<form>
			<table id="customers"> </table><br>
			<div>
				<a href="#" style="float:left;margin:0px 10px 0px 0px;"> <img src="../images/cancel.png" onclick="goBack()" width = "120" height="40"></a> 
				<a href="#" style="float:right;margin:0px 0px 0px 10px;"> <img src="../images/continue.png" onclick="NextPage()" width = "120" height="40"></a>           
           </div>
		</form>
		</div>
		 <p style="font-size:100pt;">&nbsp;</p>
	</body>
	<div style="background-image: url(../images/topbar.png); bottom:0;text-align:center;margin:0px 0px 0px 0px;" id="sample" class="ui-footer-fixed " > 
		<div style="margin:8px 0px -7px 17px;">
			<img  style="margin:0px -1px 13px -17px;" class="folder" src="../images/folder.png"  height="40" width="40" onclick="folder()">
			<img  style="margin:0px -1px 13px 19px;" class="folder" src="../images/settings.png" height="40" width="40"  onclick="settings()">
			<img  style="margin:0px -1px 13px 19px;" class="" src="../images/home.png" height="40" width="40" onclick="home()">
			<img  style="margin:0px -1px 13px 19px;" class="folder" src="../images/boulder.png" height="40" width="40" onclick="boulder()">
			<img  style="margin:0px -1px 13px 19px;" class="folder" src="../images/route.png" height="40" width="40" onclick="route()">
		</div>
	</div>
</html>

<script type="text/javascript" charset="utf-8" src="file:///android_asset/js/cordova.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
	<script>
	function signout(){
		window.location='index_login.html';
	}
	function folder(){
		<!-- window.location='http://forerunnerpro.com/?nr=0'; -->
		navigator.app.loadUrl('http://forerunnerpro.com/?nr=0', { openExternal:true });
	}
	function settings(){
		window.location='settings.html';
	}
	function home(){
		window.location='option.html';
	}
	function boulder(){
		window.location='boulder_option.html';
	}
	function route(){
		window.location='route_option.html';
	}
	
	var arr1 = [];var arr2 = [];var arr3 = [];var arr4 = [];var arr5 = [];var arr6 = [];var arr7 = [];var arr8 = [];var arr9 = [];var arr10 = [];var arr25=[];var arr11 = [];var arr12 = [];var arr13 = [];var arr28 = [];
	var arr14 = [];var arr15 = [];var arr16 = [];var arr17 = [];var arr18 = [];var arr19 = [];var arr20 = [];var arr21 = [];var arr22 = [];var arr23 = [];var arr24 = [];var arr25 = [];var arr26 = [];var arr27 = [];
	var token1=encodeURIComponent(window.localStorage["token"]);
	document.addEventListener("deviceready", updateRopeRoute, false);
	function updateRopeRoute(){
		var table='<tr><th height="10px" width="12%">Area</th><th width="14%">Grade</th><th width="13%">Color</th><th>Name</th><th width="21%">Set Date</th><th width="10%">&nbsp;&nbsp;&nbsp;</th></tr>';
		var i=0;
		$.ajax({
			type: "POST",
			url: window.localStorage["url"]+'/boulderroutesforupdate?token='+token1,
			contentType: "application/json; charset=utf-8",
			data:window.localStorage["searchValueboulder"],
			success: function(data){
				if(data.status == "SUCCESS"){
					$.each(data.data, function(key,value){
						if(key == 'results'){
							$.each(value, function(key1,value1){
								if(value1.status==window.localStorage["status"]){
									table+='<tr height="10px" id='+i+'><td height="10px" style="word-break:break-word;">'+value1.areaName+'</td><td style="word-break:break-word;">'+value1.gradeName+'</td><td style="word-break:break-word;">'+value1.colorName+'</td><td style="word-break:break-word;">'+value1.routeName+'</td><td>'+value1.createDate+'</td><td><input type="radio" id="RadioButton" name="RadioButton"  onclick="routename('+i+')"></td></tr>';
									arr1.push(value1.areaId);
									arr2.push(value1.areaName);
									arr3.push(value1.gradeId);
									arr4.push(value1.gradeName);
									arr5.push(value1.colorId);
									arr6.push(value1.colorName);
									arr7.push(value1.routeId);	
									arr8.push(value1.routeName);
									arr9.push(value1.createDate);
									arr10.push(value1.modifiedDate);
									arr11.push(value1.routeTypeId);
									arr12.push(value1.routeTypeName);
									arr13.push(value1.climbStyleId);
									arr14.push(value1.climbStyleName);
									arr15.push(value1.locationId);
									arr16.push(value1.locationName);
									arr17.push(value1.userId);
									arr18.push(value1.userName);
									arr19.push(value1.climbSystemId);
									arr20.push(value1.climbSystemName);
									arr21.push(value1.addToStripList);
									arr22.push(value1.status);
									arr23.push(value1.comment);
									arr24.push(value1.inspected);
									arr25.push(value1.forerunnerId);
									arr26.push(value1.forerunnerFirstName);
									arr27.push(value1.forerunnerLastName);
									arr28.push(value1.forerunnerUserName);
								i++;}
							});
						}
					});
					$("#customers").html( table );	
				}else if(data.errorCode=="100"){
					navigator.notification.alert("Please Sign In");
					window.location='index_login.html';
					return false;
				}
			}					
		});			
	}
	function routename(id){
		window.localStorage["areaId"]=arr1[id];
		window.localStorage["areaName"]=arr2[id];
		window.localStorage["gradeId"]=arr3[id];
		window.localStorage["gradeName"]=arr4[id];
		window.localStorage["colorId"]=arr5[id];
		window.localStorage["colorName"]=arr6[id];
		window.localStorage["routeId"]=arr7[id];
		window.localStorage["routeName"]=arr8[id];
		window.localStorage["createDate"]=arr9[id];
		window.localStorage["modifiedDate"]=arr10[id];
		window.localStorage["routeTypeId"]=arr11[id];
		window.localStorage["routeTypeName"]=arr12[id];
		window.localStorage["climbStyleId"]=arr13[id];
		window.localStorage["climbStyleName"]=arr14[id];
		window.localStorage["locationId"]=arr15[id];
		window.localStorage["locationName"]=arr16[id];
		window.localStorage["userId"]=arr17[id];
		window.localStorage["userName"]=arr18[id];
		window.localStorage["climbSystemId"]=arr19[id];
		window.localStorage["climbSystemName"]=arr20[id];
		window.localStorage["addToStripList"]=arr21[id];
		window.localStorage["status"]=arr22[id];
		window.localStorage["comment"]=arr23[id];
		window.localStorage["inspected"]=arr24[id];
		window.localStorage["forerunnerId"]=arr25[id];
		window.localStorage["forerunnerFirstName"]=arr26[id];
		window.localStorage["forerunnerLastName"]=arr27[id];
		window.localStorage["forerunnerUserName"]=arr28[id];
	}
	function goBack(){
		window.location='update_boulder.html';
	}
	function NextPage(frm){
		var count=0;
		var radio=document.getElementsByTagName('input');
		for(var i=0;i<radio.length;i++){
				if(radio[i].type=='radio'&&radio[i].checked==true){
				count++;
				}
			}
		if(count==1){
		window.location='edit_boulder.html';}
		else{
		navigator.notification.alert( "Please select your Radiobutton" );}
	}
	</script>
